//
//  TransSuccessCell.m
//  DaoZiJinFu
//
//  Created by woker on 16/6/27.
//  Copyright © 2016年 iwoker. All rights reserved.
//

#import "TransSuccessCell.h"

@implementation TransSuccessCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    TransSuccessCell *cell = [tableView dequeueReusableCellWithIdentifier:TRANSSUC_CELL];
    if (!cell) {
        cell = [[TransSuccessCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TRANSSUC_CELL];
    }
    
    return cell;
}

- (void)setUpCell {
    if (_order_type == 1) {
        switch (_status) {
            case -1:_investInfo.text = @"标记删除";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 1:_investInfo.text = @"待支付";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            case 7:_investInfo.text = @"冻结订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 8:_investInfo.text = @"终止订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 9:_investInfo.text = @"购买成功";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            default:_investInfo.text = @"ERROR";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
        }
    } else if (_order_type == 2) {
        switch (_status) {
            case -1:_investInfo.text = @"标记删除";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 1:_investInfo.text = @"待支付";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            case 7:_investInfo.text = @"冻结订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 8:_investInfo.text = @"终止订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 9:_investInfo.text = @"支付成功";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            default:_investInfo.text = @"ERROR";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
        }
    } else if (_order_type == 3) {
        switch (_status) {
            case -1:_investInfo.text = @"标记删除";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 1:_investInfo.text = @"申请赎回";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            case 7:_investInfo.text = @"冻结订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 8:_investInfo.text = @"终止订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 9:_investInfo.text = @"赎回成功";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            default:_investInfo.text = @"ERROR";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
        }
    } else if (_order_type == 4) {
        switch (_status) {
            case -1:_investInfo.text = @"标记删除";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 1:_investInfo.text = @"申请中";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            case 2:_investInfo.text = @"审核通过";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            case 3:_investInfo.text = @"转账中";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            case 7:_investInfo.text = @"冻结订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 8:_investInfo.text = @"终止订单";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
            case 9:_investInfo.text = @"提现成功";_investIcon.image = [UIImage imageNamed:@"投资成功"];break;
            default:_investInfo.text = @"ERROR";_investIcon.image = [UIImage imageNamed:@"投资失败"];break;
        }
    } else if (_order_type == -1) {     //购买成功提示
        _investInfo.text = @"购买成功";_investIcon.image = [UIImage imageNamed:@"投资成功"];
    }
}

@end
